﻿using System;
using System.Data;
using MyFloridaHouse.libSvDTO;

namespace MyFloridaHouse.DataAccess.Extensions
{
	/// <summary>
	/// RegionDTODataContract
	/// </summary>
    public static class RegionDTODataContract
    {
		/// <summary>
		/// DataContract.
		/// </summary>
		/// <param name="rdr">The RDR.</param>
		/// <returns><see cref="RegionDTO"/></returns>
        public static RegionDTO DataContract(IDataReader rdr)
        {
            var newItem = new RegionDTO
                          	{
                          		regionID = (int) rdr["regionID"],
                          		centerLngX = Convert.ToDouble(rdr["centerLngX"]),
                          		centerLatY = Convert.ToDouble(rdr["centerLatY"]),
                          		mapObject = rdr["mapObject"].ToString()
                          	};
								//mapObject = CompressionManager.Compress(rdr["mapObject"].ToString());
								//uogID = (int)rdr["uogid"]; //jdm 9/3 removed this as I don't think we are going to need it for non-building block layers
            return(newItem);
        }
    }
}
